<template>
  <div>
    <div class="head">
      <div class="sech-box">
        <img class="sech-img" src="../../assets/images/ic_group_search_small.png" alt=""/>
        <input type="text" placeholder="影视 图书 唱片 小组等" />
        <img class="saom-img" src="../../assets/images/ic_scan_gray.png"/>
      </div>
      <img class="right-img" src="../../assets/images/ic_chat_white.png" alt=""/>
    </div>
    <!-- paginationtype="fraction" -->
    <banner :autoplay="true" swiperid="mybanner1">
      <template #swiperwrapper>
        <div class="swiper-slide"><img src="../../assets/images/01.jpg" alt=""></div>
        <div class="swiper-slide"><img src="../../assets/images/02.jpg" alt=""></div>
        <div class="swiper-slide"><img src="../../assets/images/03.jpg" alt=""></div>
      </template>
    </banner>
    <!-- <br>
    <banner swiperid="mybanner2" :paginationshow="true" effect="cube">
      <template #swiperwrapper>
        <div class="swiper-slide"><img src="../../assets/images/01.jpg" alt=""></div>
        <div class="swiper-slide"><img src="../../assets/images/02.jpg" alt=""></div>
        <div class="swiper-slide"><img src="../../assets/images/03.jpg" alt=""></div>
      </template>
    </banner> -->
    <div class="contents">
      <ul>
        <li v-for="(item,index) in newarr" :key="index">
          <div class="rig">
            <h1>{{item.title}}</h1>
            <p>{{item.target.desc}}</p>
            <span>作者:{{item.target.author.name}}</span>
          </div>
          <div class="lef">
            <img :src="item.target.cover_url" alt="">
          </div>
        </li>
      </ul>
    </div>
  </div>
</template>

<script>
import banner from "../../components/banner.vue";
export default {
  components: { banner },
  data(){
    return{
      newarr:[]
    }
  },
  mounted(){
    this.$axios.get("../../../static/data/homeData.json").then(res=>{
      console.log(res.data.recommend_feeds);
      this.newarr=res.data.recommend_feeds;
    })
  }
};
</script>

<style scoped lang='less'>
.head {
  line-height: 1rem;
  background: #48bd5a;
  position: relative;
  img {
    width: 0.5rem;
    position: absolute;
    top: 0.25rem;
  }
  input {
    line-height: 0.7rem;
    padding-left: 1rem;
    width: 80%;
    margin-left: 0.2rem;
    border-radius: 5px;
  }
  .sech-img {
    left: 0.3rem;
  }
  .saom-img {
    right: 1.6rem;
  }
  .right-img {
    right: 0.3rem;
    top: 0.2rem;
    width: 0.6rem;
  }
}
.contents li{
  width: 100%;
  height: 3rem;
  border: 1px solid #ccc;
  .rig{
    width: 69%;
    float: left;
    padding: 0.3rem 0.3rem;
    h1{
      font-size: 17px;
      margin-bottom: 0.10rem;
    }
    p{
       margin-bottom: 0.10rem;
    }
    span{
      color: #ccc;
    }
  }
  .lef{
    width: 31%;
    float: right;
    margin-top: 0.3rem;
    img{
      width: 2.2rem;
    }
  }
}
</style>